Ext.namespace("Maint.Show68");

Maint.Show68.showInfo = function (){
	/* basic info */
    this.txtWoNum = new Ext.form.TextField({fieldLabel: '工单流水号',readOnly: true,width: 160 });
    this.txtCreateBy = new Ext.form.TextField({fieldLabel: '派单人',readOnly: true,width: 160 });
    this.txtContact= new Ext.form.TextField({fieldLabel: '联系方式',readOnly: true,width: 160 });
    this.txtCreateDep = new Ext.form.TextField({fieldLabel: '部门名称',readOnly: true,width: 160 });
    this.txtCreateTime = new Ext.form.DateField({fieldLabel: '派单时间',width: 160,format: 'Y-m-d',disabledDays: [0-6]});
    this.txtTopic = new Ext.form.TextArea({fieldLabel: '工单主题',readOnly: true,width: 460,height: 40 });
    /* expand info */
    this.txtFaultTime = new Ext.form.DateField({fieldLabel: '客户报障时间',width: 160,format: 'Y-m-d',disabledDays: [0-6]});
    this.txtRenewTime = new Ext.form.DateField({fieldLabel: '客户恢复时间',width: 160,format: 'Y-m-d',disabledDays: [0-6]});
    this.txtOldWoNum = new Ext.form.TextField({fieldLabel: '原工单号',readOnly: true,width: 160 });
    this.txtFalutType = new Ext.form.TextField({fieldLabel: '故障类型',readOnly: true,width: 160 });
    this.txtJtNum = new Ext.form.TextField({fieldLabel: '集团编号',readOnly: true,width: 160 });
    this.txtJtName = new Ext.form.TextField({fieldLabel: '集团名称',readOnly: true,width: 160 });
    this.txtContactMember = new Ext.form.TextField({fieldLabel: '客户联系人',readOnly: true,width: 160 });
    this.txtContactTele = new Ext.form.TextField({fieldLabel: '联系电话',readOnly: true,width: 160 });
    this.txtUrgency = new Ext.form.TextField({fieldLabel: '紧急程度',readOnly: true,width: 160 });
    this.txtComplaintSource = new Ext.form.TextField({fieldLabel: '投诉来源',readOnly: true,width: 160 });
    this.txtFaultCon = new Ext.form.TextArea({fieldLabel: '客户报障内容',readOnly: true,width: 460,height: 40 });
    this.txtPretreatment = new Ext.form.TextArea({fieldLabel: '预处理情况和处理建议',readOnly: true,width: 460,height: 40 });
    this.txtNote = new Ext.form.TextField({fieldLabel: '备注',readOnly: true,width: 460 });
    this.txtFaultPartition = new Ext.form.TextField({fieldLabel: '故障处理原因划分',readOnly: true,width: 460 });
    this.txtResult = new Ext.form.TextField({fieldLabel: '处理结果',readOnly: true,width: 460 });
    this.txtWoPeriod = new Ext.form.TextField({fieldLabel: '派单时长',readOnly: true,width: 160 });
    this.txtDealWithPeriod = new Ext.form.TextField({fieldLabel: '处理时长',readOnly: true,width: 160 });
    this.txtPigeonholeNotion = new Ext.form.TextField({fieldLabel: '归档意见',readOnly: true,width: 460 });
    
    this.colseButton = new Ext.Button({
		text:"关闭",
		handler:function(){
			this.hide();
		},
		scope:this
	});

	this.basicPanel = new Ext.form.FormPanel({
		title:'工单基本信息',
		autoHeight:true,
		autoWidth :true,
		labelWidth: 130,
		labelAlign:'right',
		region:'north',
		layout:'table',
		split:true,
		collapsible: true,
		frame:true,
		layoutConfig:{columns:2},
		style:{algin:'center'},
		items:[
			       {layout: 'form',items: [this.txtWoNum]},
			       {layout: 'form',items: [this.txtCreateBy]},
			       {layout: 'form',items: [this.txtContact]},
			       {layout:'form',items:[this.txtCreateDep]},
			       {colspan: 2,layout:'form',items:[this.txtTopic]},
			       {layout:'form',items:[this.txtCreateTime]}
		]
	});

	this.expandPanel = new Ext.form.FormPanel({
		title:'工单扩展信息',
		autoHeight:true,
		autoWidth :true,
		labelWidth: 130,
		labelAlign:'right',
		region:'north',
		layout:'table',
		split:true,
		collapsible: true,
		frame:true,
		layoutConfig:{columns:2},
		style:{algin:'center'},
		items:[
			       {layout: 'form',items: [this.txtFaultTime]},
			       {layout: 'form',items: [this.txtRenewTime]},
			       {layout: 'form',items: [this.txtOldWoNum]},
			       {layout: 'form',items: [this.txtFalutType]},
			       {layout: 'form',items: [this.txtJtNum]},
			       {layout: 'form',items: [this.txtJtName]},
			       {layout: 'form',items: [this.txtContactMember]},
			       {layout: 'form',items: [this.txtContactTele]},
			       {layout: 'form',items: [this.txtUrgency]},
			       {layout: 'form',items: [this.txtComplaintSource]},
			       {colspan: 2,layout: 'form',items: [this.txtFaultCon]},
			       {colspan: 2,layout: 'form',items: [this.txtPretreatment]},
			       {colspan: 2,layout: 'form',items: [this.txtNote]},
			       {colspan: 2,layout: 'form',items: [this.txtFaultPartition]},
			       {colspan: 2,layout: 'form',items: [this.txtResult]},
			       {layout: 'form',items: [this.txtWoPeriod]},
			       {layout: 'form',items: [this.txtDealWithPeriod]},
			       {colspan: 2,layout: 'form',items: [this.txtPigeonholeNotion]}
			       
		]
	});  
  
	this.mainPanel= new Ext.Panel({
		autoScroll: true,
		items: [this.basicPanel, this.expandPanel]
	}); 
	
	Maint.Show68.showInfo.superclass.constructor.call(this,{
		//height:580,
		width:680,
		modal:true,
		autoScroll:false,
		closeAction:'hide',
		buttonAlign:'right',
		buttons:[this.colseButton],
		items:[this.mainPanel],
		listeners:{
		}
	});
};

Ext.extend(Maint.Show68.showInfo, Ext.Window, {
	initDetail:function(data){
		this.maintId = data.MAINT_ID;
	    this.txtWoNum.setValue(data.WO_NUM);
	    this.txtCreateBy.setValue(data.CREATE_BY);
	    this.txtContact.setValue(data.CONTACT);
	    this.txtCreateDep.setValue(data.CREATE_DEP);
	    this.txtCreateTime.setValue(data.CREATE_TIME);
	    this.txtTopic.setValue(data.TOPIC);
	    this.txtFaultTime.setValue(data.FAULT_TIME);
	    this.txtRenewTime.setValue(data.RENEW_TIME);
	    this.txtOldWoNum.setValue(data.OLD_WO_NUM);
	    this.txtFalutType.setValue(data.FALUT_TYPE);
	    this.txtJtNum.setValue(data.JT_NUM);
	    this.txtJtName.setValue(data.JT_NAME);
	    this.txtContactMember.setValue(data.CONTACT_MEMBER);
	    this.txtContactTele.setValue(data.CONTACT_TELE);
	    this.txtUrgency.setValue(data.URGENCY);
	    this.txtComplaintSource.setValue(data.COMPLAINT_SOURCE);
	    this.txtFaultCon.setValue(data.FAULT_CON);
	    this.txtPretreatment.setValue(data.PRETREATMENT);
	    this.txtNote.setValue(data.NOTE);
	    this.txtFaultPartition.setValue(data.FAULT_PARTITION);
	    this.txtResult.setValue(data.RESULT);
	    this.txtWoPeriod.setValue(data.WO_PERIOD);
	    this.txtDealWithPeriod.setValue(data.DEAL_WITH_PERIOD);
	    this.txtPigeonholeNotion.setValue(data.PIGEONHOLE_NOTION);
	}
});